import request from '@/utils/request';
import {AxiosPromise} from 'axios';
import {TravelDetailsForm, TravelDetailsQuery, TravelDetailsVO} from '@/api/biz/travelDetails/types';

/**
 * 查询旅游明细列表
 * @param query
 * @returns {*}
 */

export const listTravelDetails = (query?: TravelDetailsQuery): AxiosPromise<TravelDetailsVO[]> => {
  return request({
    url: '/biz/travelDetails/list',
    method: 'get',
    params: query
  });
};


/**
 * 查询旅游明细详细
 * @param id
 */
export const getTravelDetails = (id: string | number): AxiosPromise<TravelDetailsVO> => {
  return request({
    url: '/biz/travelDetails/' + id,
    method: 'get'
  });
};

/**
 * 新增旅游明细
 * @param data
 */
export const addTravelDetails = (data: TravelDetailsForm) => {
  return request({
    url: '/biz/travelDetails',
    method: 'post',
    data: data
  });
};

/**
 * 修改旅游明细
 * @param data
 */
export const updateTravelDetails = (data: TravelDetailsForm) => {
  return request({
    url: '/biz/travelDetails',
    method: 'put',
    data: data
  });
};

/**
 * 删除旅游明细
 * @param id
 */
export const delTravelDetails = (id: string | number | Array<string | number>) => {
  return request({
    url: '/biz/travelDetails/' + id,
    method: 'delete'
  });
};
